#include <windows.h>
#include <wininet.h>

#define URL TEXT("https://www.baidu.com/")

void mainCRTStartup()
{
    HINTERNET hOpen = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
    HINTERNET hUrl = InternetOpenUrl(hOpen, URL, NULL, 0, 0, 0);
    HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
    DWORD dwSize = 0;
    do
    {
        DWORD i;
        char buf[0x100];
        InternetQueryDataAvailable(hUrl, &dwSize, 0, 0);
        for (i = 0; i < dwSize; i+= 0x100)
        {
            DWORD dwRead = 0;
            InternetReadFile(hUrl, buf, 0x100, &dwRead);
            WriteConsoleA(hStdOut, buf, dwRead, NULL, NULL);
        }
    } while (dwSize);
    InternetCloseHandle(hUrl);
    InternetCloseHandle(hOpen);
    ExitProcess(0);
}